<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateSettingTbl extends Migrator
{
    const TBL_NAME = 'setting';


    public function change()
    {
        // create the table
        $table  =  $this->table(addTablePrefix(self::TBL_NAME),[
            'engine'=>'InnoDB',
            'comment' => '设置表',
            'signed' => false
        ]);
        $table
            ->addColumn('appname', 'string',array('limit'=>32,'default'=>'','comment'=>'站点名称'))
            ->addColumn('description', 'string',array('limit'=>500,'default'=>'','comment'=>'描述'))
            ->addColumn('keywords',  'string',array('limit'=>256, 'default'=>'', 'comment'=>'关键字'))
            ->addColumn('logo', 'string',array('limit'=>125,'default'=>'','comment'=>'Logo'))
            ->addColumn('record', 'string',array('limit'=>32,'default'=>'', 'comment'=>'备案号'))
            ->addColumn('email', 'string',array('limit' => 64, 'default'=>'','comment'=>'联系邮箱'))
            ->addColumn('about', 'text',array('comment'=>'关于我'))
            ->addColumn('update_time', 'integer',array('default'=>0,'comment'=>'更新时间'))
            ->create();
    }
}
